<!doctype html>
<html>
<head>
<script src="https://code.jquery.com/jquery.js"></script>
<script src="js/klassen.js"></script>
<script>
function convertImgToBase64(url, callback, outputFormat){
    var canvas = document.createElement('CANVAS'),
        ctx = canvas.getContext('2d'),
        img = new Image;
    img.crossOrigin = 'Anonymous';
    img.onload = function(){
        canvas.height = img.height;
        canvas.width = img.width;
        ctx.drawImage(img,0,0);
        var dataURL = canvas.toDataURL(outputFormat || 'image/png');
        callback.call(this, dataURL);
        // Clean up
        canvas = null; 
    };
    img.src = url;
}

$(document).ready(function() {
	var nummer = klasIO1B4[0].nummer;
	var url    = "https://hetportaal.kw1c.nl/sites/rpc/Reserved.ReportViewerWebPart.axd?ReportSession=b3lzjjiioxsq5v55zs0zwt45&Culture=1043&CultureOverrides=True&UICulture=1043&UICultureOverrides=False&ReportStack=1&ControlID=12798f90625544d7afb8a57d0f97fca3&OpType=ReportImage&IterationId=9f024e0c7bdc4ab18d9d0a025f95d682&StreamID=b119779e42f24e88b14c1f13bc7b176e";

	convertImgToBase64(url, function(base64Img){
			$('body').append('<img src="'+ base64Img + '">');
	});
	$('body').append('<img src="'+ 'https://hetportaal.kw1c.nl/'+ klasIO1B4[0].pasfoto + '">');
	
	
	/*
var hero;
if ( localStorage.getItem('heroImg')) {
  hero = localStorage.getItem('heroImg');
}
else {
  hero = ''; 
  localStorage.setItem('heroImg',hero);
}
document.getElementById("hero-graphic").src='data:image/png;base64,' + hero;
*/

})

</script>
<body>
<script>

</script>

</body>
</html>  